home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Financial / USDebtWatch / unix-version / usdebt.c < prev    next >
C/C++ Source or Header  |  1995-06-12  |  980b  |  36 lines

  1. /* by Erik Sowa <sowa@netcom.com>.   Public domain. */
  2.  
  3. #include <stdio.h>
  4. #include <time.h>
  5.  
  6. typedef double debt_t, pop_t;
  7. extern debt_t national_scb89debt_at();
  8. extern debt_t national_aj92debt_at();
  9. extern pop_t national_pop_at();
  10. extern void debt_to_string();
  11.  
  12. void main(argc, argv)
  13.      int argc;
  14.      char **argv;
  15. {
  16.   char debtbuf[255], sharebuf[255];
  17.   time_t now;
  18.   debt_t scb89debt, aj92debt;
  19.   pop_t pop;
  20.   
  21.   now = time ((time_t*) 0);
  22.   scb89debt = national_scb89debt_at(now);
  23.   aj92debt = national_aj92debt_at(now);
  24.   pop = national_pop_at(now);
  25.   
  26.   printf("Estimates of current U.S. National Debt:\n");
  27.  
  28.   debt_to_string(scb89debt, debtbuf);
  29.   debt_to_string(scb89debt/pop, sharebuf);
  30.   printf("Survey of Current Business (1989) estimate: $%s.\n Your share: $%s.\n",debtbuf,sharebuf);
  31.  
  32.   debt_to_string(aj92debt, debtbuf);
  33.   debt_to_string(aj92debt/pop, sharebuf);
  34.   printf("Albuquerque Journal (1992) estimate:        $%s.\n Your share: $%s.\n",debtbuf,sharebuf);
  35. }
  36.